package org.example.order.service.impl;

import org.example.order.domain.Order;
import org.example.order.service.IOrdersServer;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;

import java.util.Date;
import java.util.concurrent.ExecutionException;

/**
 * Description: OrdersServerImpl
 * Author: e
 * CreateDate: 2021-08-02
 */
@Service
public class OrdersServerImpl implements IOrdersServer {


    @Override
    public Order craeteOrder(Model model) throws ExecutionException, InterruptedException {
        Order order = new Order();
        //订单id
        order.setOrderId(System.currentTimeMillis());
        //数量
        order.setNumber(1);
        //单价
        order.setPrice(5000d);
        //商品名称
        order.setProductName("HUAWEI P50 Pro 麒麟4G 全网通 8GB+256GB（曜金黑）");
        //支付状态0未支付
        order.setStatus(0);
        //下单人
        order.setUserId(10086);
        order.setAddition("待支付");
        order.setCreateTime(new Date());
        return order;
    }
}
